//
//  Member.swift
//  777Proj
//
//  Created by 陈宇 on 2017/5/12.
//  Copyright © 2017年 🐜. All rights reserved.
//

import Foundation
import ObjectMapper

class Member : BaseBean {
    
    var address : String?
    var agent : Bool?
    private var _avatar : URL?
    var avatar : URL {
        get {
            return _avatar ?? APP.APP_PLACEHOLDER_URL
        }
    }
    var companyAddress : String?
    var companyName : String?
    var companyPhone : String?
    var createDate : Date?
    var email : String?
    var emailVerified : Bool?
    var name : String?
    var phone : String?
    var username : String?
    var vipCount : Int?
    
    override func mapping(map: Map) {
        super.mapping(map: map)
        
        address <- map["address"]
        agent <- map["agent"]
        _avatar <- (map["avatar"], URLTransform())
        companyAddress <- map["company_address"]
        companyName <- map["company_name"]
        companyPhone <- map["company_phone"]
        createDate <- (map["create_date"], CustomDateFormatTransform(formatString: Constant.CUSTOM_DATE_FORMAT_STRING))
        email <- map["email"]
        emailVerified <- map["email_verified"]
        name <- map["name"]
        phone <- map["phone"]
        username <- map["username"]
        vipCount <- map["vip_count"]
    }
    
}
